<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>js的对象</title>
		<script>
			//arguments
			function Driver()
			{
				if(arguments.length>=1)
					this.name=arguments[0];
				if(arguments.length>=2)
					this.age=arguments[1];	
				if(arguments.length>=3)
					this.sex=arguments[2];
					
				this.showInfo=function(){
					return this.name+",性别:"+this.sex+",年龄:"+this.age ;
				}	
			}
			Driver.prototype.tele="1388888888"+this.age;
			var d=new Driver("老胡",35,"男");
			alert(d.showInfo()+","+d.tele);
			var d2=new Driver("老胡",35);
			alert(d2.showInfo()+","+d.tele);
			//alert(d.constructor==Driver);
			//alert(d2.constructor==Driver);
			//alert(d2 instanceof Driver);
		</script>
	</head>
	<body>
	</body>
</html>
